package com.bgs.eat.utils;

import cn.hutool.json.JSONUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
* @Author G胖
* @Description 封装websocket消息体
* @Date 2022-10-17 上午 09:37
* @Return

*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Message<T>{
    private Integer code;
    private String type;
    private T content;

    public static void main(String[] args) {
        Message<String> message = new Message<>(123,"12","dw");
        System.out.println(JSONUtil.toJsonStr(message));
    }
}
